//
//  APIRoute.swift
//  Casecord
//
//  Created by baozi on 2024/1/3.
//

import Foundation
import Alamofire
enum APIRoute: Equatable {
    case get(String)
    case post(String)
    case put(String)
    case delete(String)
    
    public var path: String {
        switch self {
        case .get(let path): return path
        case .post(let path): return path
        case .put(let path): return path
        case .delete(let path): return path
        }
    }
    
    public var method: HTTPMethod {
        switch self {
        case .get: return HTTPMethod.get
        case .post: return HTTPMethod.post
        case .put: return HTTPMethod.put
        case .delete: return HTTPMethod.delete
        }
    }
    
    static func == (lhs: Self, rhs: Self) -> Bool {
        lhs.method == rhs.method && lhs.path == rhs.path
    }
}
